package Model.check_inside_util;

import Model.DrawModel.CalPoint;
import Model.SurroundModel.Target;
import Model.SurroundModel.TargetSecond;

import java.util.ArrayList;

/**
 * 参数转换工具类
 *
 * @author dingN
 * @date 2022/07/15
 */
public class ParamChangeUtil {

    /**
     * 目标点
     *
     * @param targets 目标
     * @return {@link ArrayList}<{@link CalPoint}>
     */
    public static ArrayList<CalPoint> TargetsToPoints(ArrayList<Target> targets) {
        ArrayList<CalPoint> calPoints = new ArrayList<>();
        for (Target item : targets) {
            calPoints.add(new CalPoint(item.x, item.y));
        }
        return calPoints;
    }

    public static ArrayList<CalPoint> SecondTargetsToPoints(ArrayList<TargetSecond> targets) {
        ArrayList<CalPoint> calPoints = new ArrayList<>();
        for (TargetSecond item : targets) {
            calPoints.add(new CalPoint(item.x, item.y));
        }
        return calPoints;
    }
}
